package myschool.test;

import myschool.dao.ExamDao;
import myschool.entity.ExamResult;
import myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class QueryExam {
    public static void main(String[] args) {
        SqlSession s = MybatisUtil.get();
       ExamDao dao = s.getMapper(ExamDao.class);
        dao.findAll().forEach(System.out::println);

//        ExamResult r=new ExamResult();
//        r.setScore(77);
//        r.setSbid(4);
//        r.setStid(10);
//        r.setExamDate(new Date());
//        int add = dao.add(r);
//        System.out.println("增加的结果是："+add);
//        System.out.println(r.getId()+"是主键");
//        s.commit();
        MybatisUtil.close(s);
    }
}
